﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XZen.Cdn.Client
{
    public class ContentSetting
    {
        bool _isInitialized;

        public bool IsInitialized
        {
            get { return _isInitialized; }
            set { _isInitialized = value; }
        }

        string _userName;

        public string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }
        string _password;

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }
        static string _baseUri = "http://cdn.ipatrika.com";

        string authenticationServiceUri = ServiceResource.AuthenticationServiceEndpoint;
        string rolesUri = ServiceResource.RoleServiceEndpoint;
        string profileServiceUri = ServiceResource.ProfileServiceEndpoint;
        string blobServiceUri = ServiceResource.BlobServiceEndpoint;
        public ContentSetting(string user, string password)
            : this(user, password, _baseUri)
        {
        }
        public ContentSetting(string user, string password, string baseUri)
        {
            _userName = user;
            _password = password;
            ReInitialize(baseUri);
        }
        public string BaseUrl { get; set; }
        public string AuthenticationService { get; set; }
        public string RolesService { get; set; }
        public string ProfileService { get; set; }
        public string BlobService { get; set; }
        public void ReInitialize(string baseUrl)
        {
            BaseUrl = baseUrl;
            AuthenticationService = BaseUrl + authenticationServiceUri;
            RolesService = BaseUrl + rolesUri;
            ProfileService = BaseUrl + profileServiceUri;
            BlobService = BaseUrl + blobServiceUri;
        }

    }
}
